# -*- coding: utf-8 -*-
"""
@Time : 2024/2/26 1:33 PM
@Author: imamhusan
@Des: 事件监听
"""
from fastapi import FastAPI
from database.mysql import register_mysql
from database.redis import token_cache


def start(app: FastAPI):
    async def app_start():
        print('服务已启动')
        await register_mysql(app)
        app.state.token_redis = await token_cache()
    return app_start


def stop():
    print('服务已停止')
